package Homework.Homework03;

public class NetworkServiceImp extends Collect implements NetworkService{

    @Override
    public void connect(int internetData, SIMCard simCard) {
        simCard.setInternetData(simCard.getInternetData() - internetData);
        System.out.println("已经使用的上网流量为数为：" + internetData);
    }
    private int internetData; // 上网流量
    @Override
    public void show() {
        System.out.println("上网流量：" + getInternetData() + "  每月资费：" + getMonthlyRate() + "\t");
    }
    public NetworkServiceImp() {
    }

    public NetworkServiceImp(int internetData, int monthlyRate) {
        this.internetData = internetData;
        super.monthlyRate = monthlyRate;
    }

    public int getInternetData() {
        return internetData;
    }

    public void setInternetData(int internetData) {
        this.internetData = internetData;
    }

    public int getMonthlyRate() {
        return monthlyRate;
    }

    public void setMonthlyRate(int monthlyRate) {
        this.monthlyRate = monthlyRate;
    }
    public void show1() {
        System.out.println("上网流量：" + (getInternetData() - internetData));
    }
}

